package com.ht.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ht.domain.bo.TbProvincesBO;
import com.ht.domain.po.TbProvinces;
import com.ht.mapper.TbProvincesMapper;
import com.ht.service.TbProvincesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TbProvincesServiceImpl implements TbProvincesService {
    @Autowired
    private TbProvincesMapper tbProvincesMapper;

    @Override
    public List<TbProvincesBO> queryByProvince() {
        List<TbProvinces> list = tbProvincesMapper.selectList(null);
        List<TbProvincesBO> listt = new ArrayList<>();
        list.forEach(tbProvinces ->{
            TbProvincesBO bo = new TbProvincesBO();
            BeanUtil.copyProperties(tbProvinces,bo);
            listt.add(bo);
        });
        return listt;
    }
}
